package com.supplychainapi.service.impl.supplier;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.joindata.inf.common.basic.exceptions.ServiceException;
import com.supplychainapi.dao.prod.ScmTbsupplierlvlMapper;
import com.supplychainapi.model.ScmTbsupplierlvl;
import com.supplychainapi.param.ColTitle;
import com.supplychainapi.service.IScmTbsupplierlvlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * 供应商评级
 * @author:xiezhiwei
 * @email:xiezhiwei@niwodai.net
 * @date:2017-09-26
 *
 */
@Service
public class ScmTbsupplierlvlImpl implements IScmTbsupplierlvlService {
	
	@Autowired
	private ScmTbsupplierlvlMapper scmTbsupplierlvlMapper;

	
	@Override
	public PageInfo getTbcustpricelvlInfos(Integer pageNum, Integer pageSize) throws ServiceException {
        PageHelper.startPage(pageNum, pageSize);
        PageHelper.orderBy("fsCreateTime DESC");
        List<ScmTbsupplierlvl>  list = scmTbsupplierlvlMapper.getTbcustpricelvlInfos();
        return new PageInfo(list);
	}

    @Override
    public List<ScmTbsupplierlvl> getScmTbsupplierlvlList() throws ServiceException {
        List<ScmTbsupplierlvl> list = scmTbsupplierlvlMapper.getTbcustpricelvlInfos();
        return list;
    }

	@Override
	public List<ColTitle> getSchema() {
        List<ColTitle> list = new ArrayList<ColTitle>();
        list.add(new ColTitle("fsSupplierId","选取","center",100));
        list.add(new ColTitle("fsSupplierLvlName","供应商评级名称","center",100));
        return list;
	}

}
